package cn.seaboot.admin.quartz.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * POJO
 * quartz数据 [t_schedule_job]
 * <p>
 *
 * @author Mr.css on 2018-6-20
 */
@Schema(description = "quartz数据 [t_schedule_job] 实体类")
public class ScheduleJob implements Serializable {
    private static final long serialVersionUID = -3541357343309361051L;

    /**
     * ID
     */
    @Schema(description = "ID")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;
    /**
     * 触发器名称
     */
    @Size(max = 64)
    @Schema(description = "触发器名称")
    private String triggerName;
    /**
     * 触发器分组
     */
    @Size(max = 64)
    @Schema(description = "触发器分组")
    private String triggerGroup;
    /**
     * 任务名
     */
    @Size(max = 64)
    @Schema(description = "任务名")
    private String jobName;
    /**
     * 任务分组
     */
    @Size(max = 64)
    @Schema(description = "任务分组")
    private String jobGroup;
    /**
     * 表达式
     */
    @Size(max = 16)
    @Schema(description = "表达式")
    private String cron;
    /**
     * 描述
     */
    @Size(max = 128)
    @Schema(description = "描述")
    private String description;
    /**
     * 全类名
     */
    @Size(max = 255)
    @Schema(description = "全类名")
    private String jobClass;
    /**
     * 任务状态
     */
    @Schema(description = "任务状态")
    private Integer status;
    /**
     * 立即启动
     */
    @Schema(description = "立即启动")
    private Boolean eager;
    /**
     * 是否可用
     */
    @Schema(description = "是否可用")
    private Boolean disabled;
    /**
     * 创建时间
     */
    @NotNull()
    @Schema(description = "创建时间")
    private LocalDateTime gmtCreate;
    /**
     * 修改日期
     */
    @NotNull()
    @Schema(description = "修改日期")
    private LocalDateTime gmtModified;

    private transient Runnable runnable;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Boolean getDisabled() {
        return disabled;
    }

    public void setDisabled(Boolean disabled) {
        this.disabled = disabled;
    }

    public String getTriggerName() {
        return triggerName;
    }

    public void setTriggerName(String triggerName) {
        this.triggerName = triggerName;
    }

    public String getTriggerGroup() {
        return triggerGroup;
    }

    public void setTriggerGroup(String triggerGroup) {
        this.triggerGroup = triggerGroup;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getJobGroup() {
        return jobGroup;
    }

    public void setJobGroup(String jobGroup) {
        this.jobGroup = jobGroup;
    }

    public String getCron() {
        return cron;
    }

    public void setCron(String cron) {
        this.cron = cron;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getJobClass() {
        return jobClass;
    }

    public void setJobClass(String jobClass) {
        this.jobClass = jobClass;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Runnable getRunnable() {
        return runnable;
    }

    public void setRunnable(Runnable runnable) {
        this.runnable = runnable;
    }

    public Boolean getEager() {
        return eager;
    }

    public void setEager(Boolean eager) {
        this.eager = eager;
    }

    public LocalDateTime getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(LocalDateTime gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public LocalDateTime getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(LocalDateTime gmtModified) {
        this.gmtModified = gmtModified;
    }

    @Override
    public String toString() {
        return "ScheduleJob{" +
                "id=" + id +
                ", triggerName='" + triggerName + '\'' +
                ", triggerGroup='" + triggerGroup + '\'' +
                ", jobName='" + jobName + '\'' +
                ", jobGroup='" + jobGroup + '\'' +
                ", cron='" + cron + '\'' +
                ", description='" + description + '\'' +
                ", jobClass='" + jobClass + '\'' +
                ", status=" + status +
                ", eager=" + eager +
                ", disabled=" + disabled +
                ", gmtCreate=" + gmtCreate +
                ", gmtModified=" + gmtModified +
                ", runnable=" + runnable +
                '}';
    }
}
